import { _decorator, Component, Graphics, Color } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('DrawCircle')
export class DrawCircle extends Component {

    @property(Color)
    Color: Color = null;

    @property
    public Riduas: number = 1;

    @property
    public LineWidth: number = 1;

    start() {
        const g = this.addComponent(Graphics)!;
        g.clear();

        g.lineWidth = this.LineWidth;              // 线宽
        g.strokeColor = this.Color;     // 颜色
        // (x, y, 半径)
        g.circle(0, 0, this.Riduas);
        g.stroke();
    }
}

